<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        /* rotateX正方向往后，rotateY方向自左向右 都以左上角为起始点计算，即x和y的正方向*/
        body{
            background-color: rgba(0,0,0,0.9);
        }
        .container{
            display: flex;
            justify-content: center;
            align-items: center;
            width: 500px;
            height: 500px;
            margin: auto;
            margin-top: 100px;
            position: relative;
            background-color: white;
            border: 5px blue solid;
        }
        .square{
            
            position: absolute;
    
            width: 200px;
            height: 200px;
          
            transform-style: preserve-3d;
            animation: move 4s linear infinite;
        }
        .square div{
            width: 100%;
            height: 100%;
            position: absolute;
            border: 3px black solid;
            opacity: 0.7;
        }
        .d1{
            
            transform: rotateY(90deg) translateZ(-100px);
            background-color: aqua;
        }
        .d2{
            transform: rotateY(90deg) translateZ(100px);
            background-color: antiquewhite;
        }
        .d3{

            transform: translateZ(100px);
            background-color: aquamarine;
        }
        .d4{
            transform: translateZ(-100px);
            background-color: blue;
        }
        .d5{
            transform: rotateX(90deg) translateZ(100px);
            background-color: red;
        }
        .d6{
            transform: rotateX(90deg) translateZ(-100px);
            background-color: yellow;
        }
        @keyframes move{
            0%{
                transform: rotateX(0deg) rotateY(0deg);
            }
            100%{
                transform: rotateX(360deg) rotateY(360deg);
            }
        }
    </style>
</head>
<body>
    <h1 style="text-align: center;color: white;">立方体作业</h1>
    <div class="container">
        <div class="square">
            <div class="d1"></div>
            <div class="d2"></div>
            <div class="d3"></div>
            <div class="d4"></div>
            <div class="d5"></div>
            <div class="d6"></div>
        </div>
    </div>
</body>
</html>